<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="../assets/favicon.ico">
<title>source\jindo.Cache.js - Jindo Component - AjaxUI@NHN</title>
<link rel="stylesheet" type="text/css" href="../assets/prettify/prettify-min.css" media="screen">
<script type="text/javascript">
	var isMobile = (function() {
		var r = window.devicePixelRatio || 1;
		if (/windows phone/i.test(navigator.userAgent)) { r = 2; }
		
		var s = Math.max(screen.width / r, screen.height / r);
		
		var m = s < 1024;
		var href = m ? "api.mobile.css" : "api.css";
		document.write('<link rel="stylesheet" type="text/css" href="../assets/' + href + '" media="screen">');
		
		return m;
	})();
</script>

<script type="text/javascript" src="../assets/jindo.desktop.min.js"></script>
<script type="text/javascript" src="../assets/jindo_component.min.js"></script>
</head>
<body class="api-page">
<div id="wrap" class="api-main"><!-- 2Depth 접기 : lft_fold 추가 -->

	<div id="header">
		<h1><a href="../index.html"><span class="blind">JindoJS</span></a></h1>
		<div class="info">
			<span class="version">version 1.6.0</span>
			<span class="bar">|</span>
			<span class="help"><span class="ic_help"></span><a href="http://devcode.nhncorp.com/projects/jindo-component/issue" target="_blank">버그신고/문의</a></span>
		</div>
		<div class="menu">
			<button type="button" id="toggle_search_btn" class="btn_sch"><span class="blind">검색</span></button>
			<button type="button" id="toggle_list_btn" class="btn_snb btn_snb_on"><span class="blind">메뉴</span></button>
			<!-- [D] 클릭시 btn_sch_on,btn_snb_on 추가 -->
		</div>
	</div>

	<!-- sch_frm -->
	<div class="sch_frm hide_when_small">
		<h2 class="blind">검색</h2>
		<div class="filter">
			<input type="search" id="api-filter" placeholder="검색어를 입력하세요.">
		</div>
		<div id="search-tab" style="display:none;">
			<ul class="tabs">
			<li class="tc-tab">전체</li>
			<li class="tc-tab">키워드</li>
			<li class="tc-tab">클래스</li>
			<li class="tc-tab">메서드</li>
			<li class="tc-tab">프로퍼티</li>
			<li class="tc-tab">이벤트</li>
			</ul>
			<div class="panels">
				<ul id="api-all" class="tc-panel"></ul>
				<ul id="api-keywords" class="tc-panel"></ul>
				<ul id="api-classes" class="tc-panel"></ul>
				<ul id="api-methods" class="tc-panel"></ul>
				<ul id="api-attrs" class="tc-panel"></ul>
				<ul id="api-events" class="tc-panel"></ul>
			</div>

		</div>
	</div>
	<!-- // sch_frm -->

	<!-- container -->
	<div id="container">
		<!-- left-columns -->
		<div id="left-columns" class="sidemenu has_scrollbar">
			<h2 class="blind"><a href="../index.html"><span>APIs</span></a></h2>
<div class="snb depth1 scrollbar hide_when_small">
	<!-- [D] style="width:135px; height:384px; -->
	<div class="scrollbar-box">
		<div class="scrollbar-content">
			<div><ul>
			            <li class="">
			            	<a href="../classes/jindo.Accordion.html" class="">
			                	Accordion
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.AjaxHistory.html" class="">
			                	AjaxHistory
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.BrowseButton.html" class="">
			                	BrowseButton
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Cache.html" class="">
			                	Cache
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Calendar.html" class="">
			                	Calendar
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Canvas.html" class="">
			                	Canvas
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.CheckBox.html" class="">
			                	CheckBox
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.CircularRolling.html" class="">
			                	CircularRolling
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Clipboard.html" class="">
			                	Clipboard
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Component.html" class="">
			                	Component
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DataBridge.html" class="">
			                	DataBridge
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DatePicker.html" class="">
			                	DatePicker
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DefaultTextValue.html" class="">
			                	DefaultTextValue
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Dialog.html" class="">
			                	Dialog
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DragArea.html" class="">
			                	DragArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DropArea.html" class="">
			                	DropArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DynamicTree.html" class="">
			                	DynamicTree
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Effect.html" class="">
			                	Effect
								
								

							    
						        
						            <span class="flag static" title="static"><span class="blind">static</span></span>
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.FileUploader.html" class="">
			                	FileUploader
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.FloatingLayer.html" class="">
			                	FloatingLayer
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Foggy.html" class="">
			                	Foggy
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Formatter.html" class="">
			                	Formatter
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.HTMLComponent.html" class="">
			                	HTMLComponent
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.InlineTextEdit.html" class="">
			                	InlineTextEdit
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LayerEffect.html" class="">
			                	LayerEffect
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LayerManager.html" class="">
			                	LayerManager
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LayerPosition.html" class="">
			                	LayerPosition
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LazyLoading.html" class="">
			                	LazyLoading
								
								

							    
						        
						            <span class="flag static" title="static"><span class="blind">static</span></span>
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.ModalDialog.html" class="">
			                	ModalDialog
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.MouseGesture.html" class="">
			                	MouseGesture
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.MultipleAjaxRequest.html" class="">
			                	MultipleAjaxRequest
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.NumberFormatter.html" class="">
			                	NumberFormatter
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.NumericStepper.html" class="">
			                	NumericStepper
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Pagination.html" class="">
			                	Pagination
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Rolling.html" class="">
			                	Rolling
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.RollingChart.html" class="">
			                	RollingChart
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.RolloverArea.html" class="">
			                	RolloverArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.RolloverClick.html" class="">
			                	RolloverClick
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.ScrollBar.html" class="">
			                	ScrollBar
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.ScrollBox.html" class="">
			                	ScrollBox
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.SelectArea.html" class="">
			                	SelectArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.SelectBox.html" class="">
			                	SelectBox
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Slider.html" class="">
			                	Slider
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.StarRating.html" class="">
			                	StarRating
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.TabControl.html" class="">
			                	TabControl
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.TextRange.html" class="">
			                	TextRange
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Timer.html" class="">
			                	Timer
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Transition.html" class="">
			                	Transition
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Tree.html" class="">
			                	Tree
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.UIComponent.html" class="">
			                	UIComponent
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.UploadQueue.html" class="">
			                	UploadQueue
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.WatchInput.html" class="">
			                	WatchInput
								
								

							    
						        
			            	</a>
			            </li>
			        </ul></div>
		</div>
	</div>
	<div class="scrollbar-v">
		<div class="scrollbar-button-up"></div>
		<div class="scrollbar-track">
			<div class="scrollbar-thumb" style="top: 0px; height: 222px; "></div>
		</div>
		<div class="scrollbar-button-down"></div>
	</div>
</div>


<button type="button" title="펼치기" class="btn_open">바로가기 열기<span class="ic"></span></button>
<button type="button" title="접기" class="btn_close">바로가기 닫기<span class="ic"></span></button>

		</div>
		<!-- // left-columns -->

		<!-- main content -->
		<div id="main">
			<div class="main_fix">
				<div class="content">
	
	<h1 class="blind">source/jindo.Cache.js</h1>
	<div class="tc-panel first">
		<dl class="relation">
			<dt>파일명</dt>
			<dd>jindo.Cache.js</dd>
			<dt>경로</dt>
			<dd>source/</dd>
		</dl>
		<div id="file" class="file">
		    <pre class="code prettyprint linenums">/**
	@fileOverview&nbsp;Data&nbsp;Cache&nbsp;&nbsp;
	@author&nbsp;AjaxUI-1&nbsp;&lt;TarauS&gt;
	@version&nbsp;#__VERSION__#
**/
/**
&nbsp;&nbsp;&nbsp;&nbsp;Ajax&nbsp;통신&nbsp;시에&nbsp;받은&nbsp;데이터를&nbsp;내부적으로&nbsp;캐싱하여,&nbsp;다음&nbsp;Ajax&nbsp;요청을&nbsp;빠르게&nbsp;처리하기&nbsp;위한&nbsp;기능을&nbsp;가진다.
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;@class&nbsp;jindo.Cache
&nbsp;&nbsp;&nbsp;&nbsp;@extends&nbsp;jindo.Component
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;@keyword&nbsp;cache,&nbsp;캐시,&nbsp;캐쉬,&nbsp;성능,&nbsp;ajax
**/
jindo.Cache&nbsp;=&nbsp;jindo.$Class({
	/**
		@constructor
		@param&nbsp;{Object}&nbsp;[htOption]&nbsp;초기화&nbsp;옵션
			@param&nbsp;{Number}&nbsp;[htOption.nCacheLimit=100]&nbsp;캐시의&nbsp;최대&nbsp;저장&nbsp;개수
			@param&nbsp;{Number}&nbsp;[htOption.nExpireTime=600]&nbsp;캐시의&nbsp;기본&nbsp;유효&nbsp;시간&nbsp;(600초이며,&nbsp;데이터가&nbsp;추가된&nbsp;지,&nbsp;60분&nbsp;후에는&nbsp;유효하지&nbsp;않음)
		@example
			var&nbsp;oCache&nbsp;=&nbsp;new&nbsp;jindo.Cache({&#39;nCacheLimit&#39;&nbsp;:&nbsp;15});
			oCache.add(&#39;key1&#39;,&nbsp;&#39;value1&#39;,&nbsp;5&nbsp;*&nbsp;60);
			oCache.add(&#39;key2&#39;,&nbsp;&#39;value2&#39;);
			oCache.add({&#39;key1&#39;:true,&nbsp;&#39;key2&#39;:false},&nbsp;{&#39;value1&#39;:10,&nbsp;&#39;value2&#39;:20});

			//&nbsp;vResult&nbsp;is&nbsp;&#39;value1&#39;
			var&nbsp;vResult&nbsp;=&nbsp;oCache.get(&#39;key1&#39;);

			//&nbsp;vResult&nbsp;is&nbsp;{&#39;value1&#39;:10,&nbsp;&#39;value2&#39;:20}
			var&nbsp;vResult&nbsp;=&nbsp;oCache.get({&#39;key1&#39;:true,&nbsp;&#39;key2&#39;:false});&nbsp;

			oCache.remove(&#39;key1&#39;);
			oCache.clear();
	**/
	$init&nbsp;:&nbsp;function(htOption){
		this._htCacheData&nbsp;=&nbsp;{};
		this._htExpireTime&nbsp;=&nbsp;{};
		this._waKeyList&nbsp;=&nbsp;jindo.$A();
		
		this.option({
			nCacheLimit&nbsp;:&nbsp;50,
			nExpireTime&nbsp;:&nbsp;0
		});
		this.option(htOption);
	},

	/**
		데이터를&nbsp;캐시함
		
		@method&nbsp;add
		@param&nbsp;{Variant}&nbsp;vKey&nbsp;저장할&nbsp;데이터를&nbsp;구분할&nbsp;키&nbsp;값&nbsp;(String&nbsp;타입과&nbsp;Object&nbsp;타입&nbsp;모두&nbsp;가능)
		@param&nbsp;{Variant}&nbsp;vValue&nbsp;저장할&nbsp;데이터
		@param&nbsp;{Number}&nbsp;[nExpireTime=0]&nbsp;캐시&nbsp;데이터가&nbsp;폐기될&nbsp;시간&nbsp;(nExpireTime&nbsp;이후에&nbsp;폐기되며,&nbsp;초로&nbsp;입력)
		@return&nbsp;{Boolean}&nbsp;추가에&nbsp;성공하면&nbsp;true,&nbsp;실패하면&nbsp;false
		@example
			//&nbsp;문자열&nbsp;키를&nbsp;이용하여&nbsp;데이터&nbsp;캐싱
			oCache.add(&quot;string_key&quot;,&nbsp;[0,&nbsp;1,&nbsp;2]);

			//&nbsp;HashTable&nbsp;형태의&nbsp;객체&nbsp;키를&nbsp;이용하여&nbsp;데이터&nbsp;캐싱
			oCache.add({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;},&nbsp;[0,&nbsp;1,&nbsp;2]);

			//&nbsp;데이터&nbsp;캐싱&nbsp;시에,&nbsp;해당&nbsp;데이터의&nbsp;유효&nbsp;시간을&nbsp;설정
			//&nbsp;(120초&nbsp;후에는&nbsp;컴포넌트&nbsp;내부에서&nbsp;데이터&nbsp;삭제)
			oCache.add({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;},&nbsp;[0,&nbsp;1,&nbsp;2],&nbsp;120);
	**/
	add&nbsp;:&nbsp;function(vKey,&nbsp;vValue,&nbsp;nExpireTime){
		if(vKey&nbsp;&amp;&amp;&nbsp;vValue){
			this._checkCacheExpire();
			this._checkCacheLimit();
			
			var&nbsp;sKey&nbsp;=&nbsp;this._makeKey(vKey);
			if&nbsp;(sKey)&nbsp;{
				this._htCacheData[sKey]&nbsp;=&nbsp;vValue;
				this._htExpireTime[sKey]&nbsp;=&nbsp;this._getExpireTime(nExpireTime);
				this._waKeyList.push(sKey);
				return&nbsp;true;
			}&nbsp;
		}
		return&nbsp;false;
	},
	
	/**
		캐시된&nbsp;데이터를&nbsp;삭제함
		
		@method&nbsp;remove
		@param&nbsp;{Varinat}&nbsp;vKey&nbsp;캐시&nbsp;데이터의&nbsp;키&nbsp;값
		@return&nbsp;{Boolean}&nbsp;삭제에&nbsp;성공하면&nbsp;true,&nbsp;실패하면&nbsp;false
		@example
			//&nbsp;데이터&nbsp;추가
			oCache.add({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;},&nbsp;[0,&nbsp;1,&nbsp;2]);
			
			//&nbsp;데이터를&nbsp;추가할&nbsp;때&nbsp;전달했던&nbsp;키를&nbsp;동일하게&nbsp;전달하여&nbsp;내부&nbsp;데이터&nbsp;삭제
			oCache.remove({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;});
	**/
	remove&nbsp;:&nbsp;function(vKey){
		if(vKey){
			var&nbsp;sKey&nbsp;=&nbsp;this._makeKey(vKey);
			if(this._htCacheData[sKey]){
				this._waKeyList&nbsp;=&nbsp;this._waKeyList.refuse(sKey);
				delete&nbsp;this._htExpireTime[sKey];
				delete&nbsp;this._htCacheData[sKey];
				return&nbsp;true;
			}
		}
		return&nbsp;false;
	},
	
	/**
		캐시된&nbsp;데이터&nbsp;모두를&nbsp;삭제&nbsp;함

		@method&nbsp;clear
		@example
			//&nbsp;데이터&nbsp;추가
			oCache.add({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;},&nbsp;[0,&nbsp;1,&nbsp;2]);
			oCache.add({&quot;key1&quot;&nbsp;:&nbsp;&quot;1&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;2&quot;},&nbsp;[0,&nbsp;0,&nbsp;0]);
			
			//&nbsp;clear()&nbsp;메서드를&nbsp;호출하여,&nbsp;추가된&nbsp;모든&nbsp;데이터를&nbsp;삭제&nbsp;함
			oCache.clear();
	**/
	clear&nbsp;:&nbsp;function(){
		this._htCacheData&nbsp;=&nbsp;{};
		this._htExpireTime&nbsp;=&nbsp;{};
		this._waKeyList&nbsp;=&nbsp;jindo.$A();
	},
	
	/**
		vKey에&nbsp;해당하는&nbsp;캐시된&nbsp;데이터를&nbsp;리턴함
		
		@method&nbsp;get
		@param&nbsp;{Variant}&nbsp;vKey&nbsp;캐시&nbsp;데이터의&nbsp;키&nbsp;값
		@return&nbsp;{Variant}&nbsp;캐시된&nbsp;데이터
		@example
			//&nbsp;데이터&nbsp;추가
			oCache.add({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;},&nbsp;[0,&nbsp;1,&nbsp;2]);
			
			//&nbsp;데이터를&nbsp;추가할&nbsp;때&nbsp;전달했던&nbsp;키를&nbsp;동일하게&nbsp;전달
			//&nbsp;vResult&nbsp;is&nbsp;[0,&nbsp;1,&nbsp;2]
			var&nbsp;vResult&nbsp;=&nbsp;oCache.get({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;});
	**/
	get&nbsp;:&nbsp;function(vKey){
		if&nbsp;(vKey){
			var&nbsp;sKey&nbsp;=&nbsp;this._makeKey(vKey);
			if(this.check(vKey)){
				return&nbsp;this._htCacheData[sKey];
			}
		}
		return&nbsp;null;
	},
	
	/**
		vKey에&nbsp;해당하는&nbsp;캐시&nbsp;데이터의&nbsp;유효성을&nbsp;검사하여&nbsp;리턴
		
		@method&nbsp;check
		@param&nbsp;{Variant}&nbsp;vKey&nbsp;캐시&nbsp;데이터의&nbsp;키&nbsp;값
		@return&nbsp;{Boolean}&nbsp;캐시&nbsp;데이터의&nbsp;유효성
		@example
			//&nbsp;데이터&nbsp;추가
			oCache.add({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;},&nbsp;[0,&nbsp;1,&nbsp;2]);
			
			//&nbsp;데이터를&nbsp;추가할&nbsp;때&nbsp;전달했던&nbsp;키를&nbsp;동일하게&nbsp;전달
			//&nbsp;bResult&nbsp;is&nbsp;true,&nbsp;bResult2&nbsp;is&nbsp;false
			var&nbsp;bResult&nbsp;=&nbsp;oCache.check({&quot;key1&quot;&nbsp;:&nbsp;&quot;a&quot;,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;&quot;b&quot;});
			var&nbsp;bResult2&nbsp;=&nbsp;oCache.check({&quot;key1&quot;&nbsp;:&nbsp;1,&nbsp;&quot;key2&quot;&nbsp;:&nbsp;2});
	**/
	check&nbsp;:&nbsp;function(vKey){
		if(vKey){
			var&nbsp;sKey&nbsp;=&nbsp;this._makeKey(vKey);
			if(this._htCacheData[sKey]&nbsp;&amp;&amp;&nbsp;this._checkCacheExpire(sKey)){
				return&nbsp;true;
			}
		}
		return&nbsp;false;
	},

	/**
		저장되어&nbsp;있는&nbsp;캐시의&nbsp;개수를&nbsp;체크하여,&nbsp;옵션의&nbsp;캐시&nbsp;최대값보다&nbsp;클&nbsp;경우,&nbsp;가장&nbsp;먼저&nbsp;저장된&nbsp;항목을&nbsp;삭제&nbsp;함
		
		@method&nbsp;_checkCacheLimit
		@private
	**/
	_checkCacheLimit&nbsp;:&nbsp;function(){
		if(this._waKeyList.length()&nbsp;==&nbsp;this.option(&quot;nCacheLimit&quot;)){
			this.remove(this._waKeyList.get(0));
		}
	},
	
	/**
		sKey에&nbsp;해당하는&nbsp;캐시&nbsp;데이터가&nbsp;유효한지&nbsp;검사
		
		@method&nbsp;_checkCacheExpire
		@private
		@param&nbsp;{String}&nbsp;sKey&nbsp;문자열로&nbsp;변환된&nbsp;캐시&nbsp;데이터의&nbsp;키&nbsp;값
		@return&nbsp;{Boolean}&nbsp;유효&nbsp;여부
	**/
	_checkCacheExpire&nbsp;:&nbsp;function(sKey){
		if(sKey){
			var&nbsp;nTime&nbsp;=&nbsp;this._getTime();
			if(this._htExpireTime[sKey]&nbsp;===&nbsp;0&nbsp;||&nbsp;nTime&nbsp;&lt;&nbsp;this._htExpireTime[sKey]){
				return&nbsp;true;
			}else{
				this.remove(jindo.$S(sKey).parseString());
				return&nbsp;false;
			}
		}else{
			for(var&nbsp;i=0,&nbsp;n=this._waKeyList.length();&nbsp;i&lt;n;&nbsp;i++){
				return&nbsp;this._checkCacheExpire(this._waKeyList.get(i));
			}
		}
	},
	
	/**
		nExpireTime을&nbsp;기준으로&nbsp;캐시의&nbsp;만료&nbsp;시간을&nbsp;계산하여&nbsp;리턴&nbsp;함

		@method&nbsp;_getExpireTime
		@private
		@param&nbsp;{Number}&nbsp;[nExpireTime]&nbsp;캐시&nbsp;만료&nbsp;시간&nbsp;(생략할&nbsp;경우&nbsp;옵션에&nbsp;설정된&nbsp;값을&nbsp;기준으로&nbsp;계산)
		@return&nbsp;{Number}&nbsp;계산된&nbsp;캐시&nbsp;만료&nbsp;시간
	**/
	_getExpireTime&nbsp;:&nbsp;function(nExpireTime){
		if&nbsp;(nExpireTime)&nbsp;{
			return&nbsp;this._getTime()&nbsp;+&nbsp;(nExpireTime&nbsp;*&nbsp;1000);
		}&nbsp;else&nbsp;if&nbsp;(this.option(&quot;nExpireTime&quot;)){
			return&nbsp;this._getTime()&nbsp;+&nbsp;(this.option(&quot;nExpireTime&quot;)&nbsp;*&nbsp;1000);
		}&nbsp;else&nbsp;{
			return&nbsp;0;
		}
	},
	
	/**
		vKey가&nbsp;HashTable인&nbsp;경우&nbsp;문자열&nbsp;키로&nbsp;변경하여&nbsp;리턴

		@method&nbsp;_makeKey
		@private
		@param&nbsp;{Variant}&nbsp;vKey&nbsp;캐시&nbsp;데이터의&nbsp;키&nbsp;값
		@return&nbsp;{String}&nbsp;문자열로&nbsp;변환된&nbsp;캐시&nbsp;데이터의&nbsp;키&nbsp;값
	**/
	_makeKey&nbsp;:&nbsp;function(vKey){
		if(vKey){
			if(typeof(vKey)&nbsp;==&nbsp;&quot;string&quot;){
				return&nbsp;vKey;
			}&nbsp;else{
				try&nbsp;{
					return&nbsp;jindo.$H(vKey).toQueryString();
				}&nbsp;catch(e)&nbsp;{
					return&nbsp;&quot;&quot;;
				}
			}
		}&nbsp;else&nbsp;{
			return&nbsp;&quot;&quot;;
		}
	},
	
	/**
		현재&nbsp;시간을&nbsp;리턴한다.
		
		@method&nbsp;_getTime
		@private
		@return&nbsp;{Number}&nbsp;현재&nbsp;시간&nbsp;(유닉스&nbsp;타임스탬프&nbsp;값)
	**/
	_getTime&nbsp;:&nbsp;function(){
		return&nbsp;+new&nbsp;Date();
	},
	
	/**
		컴포넌트&nbsp;소멸자
		
		@method&nbsp;destroy
	**/
	destroy&nbsp;:&nbsp;function(){
		this._waKeyList&nbsp;=&nbsp;null;
		this._htCacheData&nbsp;=&nbsp;null;
		this._htExpireTime&nbsp;=&nbsp;null;
	}
}).extend(jindo.Component);</pre>
		</div>
	</div>
</div>

			</div>
		</div>
		<!-- // main content -->

	</div>
	<!-- // container -->

	<!-- footer -->
	<div id="footer">
		<p>Copyright ©<a href="http://nhncorp.com/" target="_blank">NHN Corp.</a> Platform Ajax Team. All Rights Reserved.</p>
	</div>
	<!-- // footer -->

</div>
<!-- // wrap -->

<style type="text/css">

	.item {
		transition:background .2s linear;
		-webkit-transition:background .2s linear;
		-moz-transition:background .2s linear;
		-o-transition:background .2s linear;
		-ms-transition:background .2s linear;
	}
	
	.highlight {
		background-color:#ffffd8 !important;
	}
	
	li.selected a.highlight {
		background-color:#aa8 !important;
	}
	
	.hide-deprecated .deprecated-item, .hide-inherited .inherited-item, .private {
		display:none;
	}
	
	.scrollbar-v, .scrollbar-h { display:none; }
	.scrollbar-show { display:block; }
	
	.api-page .tbl_fold .more_history { display:none; }
	
	/* FILE */
	.file pre.code {
		border:1px solid #ccc;
		padding:0;
	}
	
	.file ol {
		padding-left: 4em;
		background-color: #f9f9f9;
	}

	.file ol li {
		list-style: decimal;
		border-left:1px solid #ccc;
		padding:2px 4px;
	}
	
	.file li.L1, .file li.L3, .file li.L5, .file li.L7, .file li.L9 {
		background-color: #f9f9f9;	
	}

	.file li.L0, .file li.L2, .file li.L4, .file li.L6, .file li.L8 { 
		background-color: #f0f0f0;
	}
	
</style>
<script type="text/javascript" src="../assets/prettify/prettify-min.js"></script>
<script type="text/javascript" src="../assets/hash.js"></script>
<script type="text/javascript" src="../assets/api-list.js"></script>
<script type="text/javascript" src="../assets/api-search.js"></script>
<script type="text/javascript" src="../assets/../api.js?callback=APISearch.setData"></script>
<script type="text/javascript">
	var projectRoot = "../";
	var projectAssets = "../assets";
	
    apiDocs(projectAssets);	
</script>
</body>
</html>